package com.ych.DemoSSM.usercenter.web.controller;

import com.ych.DemoSSM.common.util.SystemUtils;
import com.ych.DemoSSM.usercenter.biz.service.UserService;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

import io.swagger.annotations.ApiOperation;

@Controller
@RequestMapping("user")
public class UserController {
    @Resource(name = "UserService")
    private UserService userService;
    /**
     * 查询当前客户信息
     *
     * @param
     * @return
     */
    @RequestMapping(value = "queryCurrentUserInfo.do", method = RequestMethod.GET)
    @ApiOperation(value = "查询当前客户信息",httpMethod = "GET",produces = MediaType.APPLICATION_JSON_VALUE)
    @ResponseBody
    public Map<String, Object> queryCurrentUserInfo(String mobile) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("mobile", mobile);
        Map<String, Object> userInfo = this.userService.getUserInfo(params);
        Map<String, Object> data = new HashMap<String, Object>();
        data.put("userInfo", userInfo);

        return SystemUtils.getSuccessMap(data);
    }
}
